<?php
/**
 * home components.
 *
 * @package    myarticles
 * @subpackage home
 * @author     Apul Gupta<apulmca2k4@gmail.com>
 */
class articleComponents extends sfComponents
{
    public function executeRecent()
    {
        $criteria = new Criteria();
        $criteria->add(ArticlePeer::IS_ACTIVE, 1);
        $criteria->addDescendingOrderByColumn(ArticlePeer::UPDATED_AT);
        $criteria->addDescendingOrderByColumn(ArticlePeer::ID);
        $criteria->setLimit(sfConfig::get('app_home_number_of_articles'));
        $this->articles = ArticlePeer::doSelect($criteria);
        $this->wordLength = sfConfig::get('app_home_word_length');       
    }
}

?>
